package priv.pront.code.national.acwing.graph;

import java.util.Scanner;

public class 图的存储 {
    static int[] v, ne, h;
    static int idx;

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        v = new int[n + 10];
        h = new int[n];
        ne = new int[n + 10];
        for (int i = 0; i < n; i++) {
            int a = scanner.nextInt();
            int b = scanner.nextInt();
            add(a, b);
        }
    }

    /**
     * b -> a
     *
     * @param a 入边
     * @param b 出边
     */
    private static void add(int a, int b) {
        v[idx] = b;
        ne[idx] = a;
        h[a] = idx++;
    }
}
